package com.lj.universalframework.base

import android.app.Activity
import android.os.Bundle
import java.util.*

class PageJumpBase {
    //需要跳转的页面class
    private var cla: Class<out Activity?>? = null
    //传参方式 默认true--->Intent false--->Bundle
    private var passing_method = true
    //Intent传参内容
    private var intentContent: HashMap<String, out Any>? = null
    //Bundle传参内容
    private var bundleContent: Bundle? = null

    fun PageJumpBase(
        cla: Class<out Activity?>?,
        intentContent: HashMap<String, out Any>?
    ) {
        this.cla = cla
        passing_method = true
        this.intentContent = intentContent
    }

    fun PageJumpBase(
        cla: Class<out Activity?>?,
        bundleContent: Bundle?
    ) {
        this.cla = cla
        passing_method = false
        this.bundleContent = bundleContent
    }


    fun getCla(): Class<out Activity?>? {
        return cla
    }

    fun getPassing_method(): Boolean? {
        return passing_method
    }

    fun getIntentContent(): HashMap<String, out Any>? {
        if (intentContent == null) {
            intentContent = HashMap()
        }
        return intentContent
    }

    fun getBundleContent(): Bundle? {
        if (bundleContent == null) {
            bundleContent = Bundle()
        }
        return bundleContent
    }
}